﻿//*** Guidance generated code ***//
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;

using $prjsn$.Aop;
using $prjsn$.Tools.IoC;

namespace $safeprojectname$
{
    public static class FilterConfig
    {
        public static void RegisterGlobalFilters(GlobalFilterCollection filters)
        {
            RegisterMvcFilters(filters);
            RegisterAopFilters();
        }

        static void RegisterAopFilters()
        {
            AopFilterManager.Init();
        }

        static void RegisterMvcFilters(GlobalFilterCollection filters)
        {
            filters.Add(new AccessFilterAttribute()); // MUST to have - Authorization
            filters.Add(new MessagesFilterAttribute());
            // MUST to have - Keeps the same Messages list among many compounded Redirections
            filters.Add(new ExceptionHandlerAttribute());
            // MUST to have - Clears everything for later correct application restart
            filters.Add(new ChangeRoleAttribute());
            // GOOD to have - if Project.config allowes CurrentRole, this will do the needed stuf
            filters.Add(new ModelManagerFilterAttribute());
            // GOOD to have - Fills model(s) with the Action and Controller name...
            filters.Add(new ActionLoggerAttribute());
            // GOOD to have - Automatically logs actions based on settings in Log4Net.config
            filters.Add(new MasterPageSelectorAttribute());
            // NICE to have - allowes selecting the MasterPage for any opened window
            filters.Add(new ValidateInputAttribute(false)); //MUST - to turn that off...
            filters.Add(new Html5IEFixFilter()); //MUST - to fix it for IE 8 and older
        }
    }
}